## 项目启动
import time

from crawler.connection import filter_push_redis, redis_conn, redis_shedana

url_list = [
    "/en-us/mens/clothing/blazers",
    "/en-us/mens/clothing/cashmere",
    "/en-us/mens/clothing/casual-shirts",
    "/en-us/mens/clothing/coats-and-jackets",
    "/en-us/mens/clothing/corduroy",
    "/en-us/mens/clothing/denim",
    "/en-us/mens/clothing/formal-shirts",
    "/en-us/mens/clothing/jeans",
    "/en-us/mens/clothing/knitwear",
    "/en-us/mens/clothing/linen",
    "/en-us/mens/clothing/polo-shirts",
    "/en-us/mens/clothing/pyjamas",
    "/en-us/mens/clothing/shorts",
    "/en-us/mens/clothing/suits",
    "/en-us/mens/clothing/sweats",
    "/en-us/mens/clothing/swimwear",
    "/en-us/mens/clothing/t-shirts",
    "/en-us/mens/clothing/trousers",
    "/en-us/mens/clothing/tuxedos",
    "/en-us/mens/clothing/underwear",
    "/en-us/mens/shoes/boat-shoes",
    "/en-us/mens/shoes/boots",
    "/en-us/mens/shoes/brogues",
    "/en-us/mens/shoes/derby-shoes",
    "/en-us/mens/shoes/driving-shoes",
    "/en-us/mens/shoes/espadrilles",
    "/en-us/mens/shoes/formal-shoes",
    "/en-us/mens/shoes/loafers",
    "/en-us/mens/shoes/monk-strap-shoes",
    "/en-us/mens/shoes/oxford-shoes",
    "/en-us/mens/shoes/sandals",
    "/en-us/mens/shoes/shoe-accessories",
    "/en-us/mens/shoes/slides",
    "/en-us/mens/shoes/slippers",
    "/en-us/mens/shoes/sneakers",
    "/en-us/mens/shoes/sport-shoes",
    "/en-us/mens/shoes/suede-shoes",
    "/en-us/mens/shoes/winter-shoes",
    "/en-us/mens/accessories/bags",
    "/en-us/mens/accessories/belts",
    "/en-us/mens/accessories/cufflinks-and-tie-clips",
    "/en-us/mens/accessories/fine-jewellery",
    "/en-us/mens/accessories/glasses",
    "/en-us/mens/accessories/gloves",
    "/en-us/mens/accessories/hats",
    "/en-us/mens/accessories/jewellery",
    "/en-us/mens/accessories/keyrings",
    "/en-us/mens/accessories/pocket-squares",
    "/en-us/mens/accessories/scarves",
    "/en-us/mens/accessories/socks",
    "/en-us/mens/accessories/sunglasses",
    "/en-us/mens/accessories/tech-accessories",
    "/en-us/mens/accessories/ties",
    "/en-us/mens/accessories/umbrellas",
    "/en-us/mens/accessories/wallets",
    "/en-us/mens/accessories/watches",
    "/en-us/mens/kidswear/accessories",
    "/en-us/mens/kidswear/clothing",
    "/en-us/mens/kidswear/shoes",
    "/en-us/mens/luxury-watches/aviation-watches",
    "/en-us/mens/luxury-watches/chronograph-watches",
    "/en-us/mens/luxury-watches/diving-watches",
    "/en-us/mens/luxury-watches/dress-watches",
    "/en-us/mens/luxury-watches/exclusives-and-limited-editions",
    "/en-us/mens/luxury-watches/smart-watches",
    "/en-us/mens/luxury-watches/sports-watches",
    "/en-us/mens/luxury-watches/table-clocks",
    "/en-us/mens/luxury-watches/watch-accessories",
    "/en-us/mens/sport/accessories",
    "/en-us/mens/sport/bottoms",
    "/en-us/mens/sport/cycling",
    "/en-us/mens/sport/equipment",
    "/en-us/mens/sport/golf",
    "/en-us/mens/sport/jackets",
    "/en-us/mens/sport/outdoor",
    "/en-us/mens/sport/running",
    "/en-us/mens/sport/shoes",
    "/en-us/mens/sport/ski-and-snow",
    "/en-us/mens/sport/socks",
    "/en-us/mens/sport/swimming",
    "/en-us/mens/sport/tennis",
    "/en-us/mens/sport/tops",
    "/en-us/mens/sport/training",
    "/en-us/mens/whats-new/clothing",
    "/en-us/mens/whats-new/shoes",
    "/en-us/mens/whats-new/accessories",
    "/en-us/mens/whats-new/sport",
    "/en-us/mens/whats-new/home-and-tech",
    "/en-us/mens/whats-new/grooming",
    "/en-us/mens/whats-new/luxury-watches",
    "/en-us/mens/whats-new/fine-jewellery",
    "/en-us/mens/whats-new/kidswear",

]

for index, url in enumerate(url_list):
    task = {
        "jobId": index,
        'url': url,
        # 'code': url,
        'domain': 'mrporter'.upper(),
        'filename': 'main',
        'types': 'electronic_business',
        "scheduleTime": int(time.time() * 1000),
        "triggerChannel": 'SONIC_SPIDER',
    }
    result = filter_push_redis(redis_conn, f'{task["types"]}_{task["filename"]}_{task["domain"]}', task)
    # result = filter_push_redis(redis_shedana, f'{task["types"]}_{task["filename"]}_{task["domain"]}', task)
    print(result)
    # input()
